class Animal {
    String name;
    int age;

    void eat() {
        System.out.println(name + "在吃东西");
    }
}
class Dog extends Animal{
    String name = "旺财";
    void wag() {
        super.name = "阿福";
        System.out.println(super.name + "摇尾巴");
    }
    void eat() {
        System.out.println(name + "吃完了");
    }
}
class Person {}
class Student {}

abstract class Shape {
    abstract void draw();
}
class Rect extends Shape{
    double length;
    double width;
    Rect(double length, double width) {
        this.length = length;
        this.width = width;
    }
    void draw() {
        System.out.println("矩形，长：" + length + " 宽：" + width);
    }
}
interface USB {
    void openDevice();
    void closeDevice();
}
class Mouse implements USB {
    public void openDevice() {
        System.out.println("打开鼠标");
    }

    @Override
    public void closeDevice() {
        System.out.println("关闭鼠标");
    }
}
public class Test {
    public static void main(String[] args) {
        Rect rect1 = new Rect(1.11,0.55);
        rect1.draw();
        /*
        Dog dog1 = new Dog();
        dog1.eat();
        dog1.wag();
        */
        /*
        function(new Person());
        function(new Student());
        */
    }
    public static void function(Object obj) {
        System.out.println(obj);
    }
}
